<?php


namespace app\api\model\dao;


use think\Model;

class ManbiRule extends Model
{
    protected $table = 'manbi_rule';
    protected $pk = 'rule_id';
    protected $autoWriteTimestamp = true;

    /**
     * @return false|\PDOStatement|string|\think\Collection
     */
    public function getAllRules()
    {
        $conds = [
            'status' => '0'
        ];
        return $this->where($conds)->select();
    }

    public function getAllRulesPage()
    {
        $conds = [
            'status' => '0'
        ];
        return $this->where($conds)->paginate(10);
    }


    public function getCreateTimeAttr($value)
    {
        return date("Y-m-d h:i:m", $value);
    }

    public function getUpdateTimeAttr($value)
    {
        return date("Y-m-d h:i:m", $value);
    }

}